<!DOCTYPE html>
<html>
<head>
	<title>遍历对象</title>                                                                                
	<meta charset="UTF-8">
	<script>
		// let arr=['pink','red','blue']
        // for(let k in arr){
        //     console.log(k)
        //     console.log(arr[k])
        
        // }
            //k拿过来的是字符串   --->下标索引
        let obj={
            name:'小明',
            age:20,
            gender:'男'
        }

        for (let k in obj){
            console.log(k)
            // k拿过来的是带引号的属性名
            console.log(obj.name)
            console.log(obj[k])
        }

            
	</script>
</head>                                                                                                   
<body>
</body>                                                                                                   
</html>                                                                                                   